<?php
require_once "../include/connectionHandlers/database/IDataTable.php";
require_once "../include/connectionHandlers/database/AbstractDataTable.php";
require_once "../include/connectionHandlers/database/Article.php";
require_once "../include/connectionHandlers/database/Categorie.php";
require_once "../include/connectionHandlers/database/Voyage.php";

class menuFromDataBase{

//Properties
	private $menuList;
	
	public function __construct()
	{
	}
	
	public function printMenuVoyage()
	{
		$toEcho = "";

		$toEcho .= "<ul class='subMenuList' id='voyageList'>";
			
		//Load Event List
		$event = new Voyage();
		$arrayMenu = $event->selectAll();
		foreach($arrayMenu as $key=>$value)
		{
			$toEcho .= '<a  href="voyages.php?voyage='.$key.'"><li class="subMenuItem" id="voyageItem'.$key.'" >'.ucwords(strtolower($value["name"])).'</li></a>';
		}
		$toEcho .= "</ul>";
		echo $toEcho;
	}
	
	public function printMenuArticle()
	{
		$toEcho = "";

		$toEcho .= "<ul class='subMenuList' id='artcleList'>";
			
		//Load Event List
		$event = new Article();
		$arrayMenu = $event->selectAll();
		foreach($arrayMenu as $key=>$value)
		{
			$toEcho .= '<a  href="article.php?article='.$key.'"><li class="subMenuItem" id="articleItem'.$key.'" >'.ucwords(strtolower($value["name"])).'</li></a>';
		}
		$toEcho .= "</ul>";
		echo $toEcho;
	}
	
	public function printMenuCategorie()
	{
		$toEcho = "";

		$toEcho .= "<ul class='subMenuList' id='categorieList'>";
			
		//Load Event List
		$event = new Categorie();
		$arrayMenu = $event->selectAll();
		foreach($arrayMenu as $key=>$value)
		{
			$toEcho .= '<a  href="categorie.php?categorie='.$key.'"><li class="subMenuItem" id="categorieItem'.$key.'" >'.ucwords(strtolower($value["name"])).'</li></a>';
		}
		$toEcho .= "</ul>";
		echo $toEcho;
	}
}

?>